package com.basics.logging.repository;

import com.basics.logging.domain.Log;
import com.basics.logging.service.dto.LogQueryCriteria;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**功能描述：日志持久层
 * @Author Geordie
 * @ClassName LogRepository
 * @Date 2021/7/8
 * @Annotation
 */
@Mapper
public interface LogRepository  {

    List<Log> findAll(@Param("criteria") LogQueryCriteria criteria);

    /**
     * 查看异常日志详情
     * @param id 日志ID
     * @return
     */
    Log findById(Long id);

    /**
     * 存入日志
     * @param log
     * @return
     */
    void save(@Param("log") Log log);

    /**
     * 删除日志
     * @param type
     * @return
     */
    void deleteByLogType(String type);
}
